package com.ipDev.moyvSys.controller.user;


import com.ipDev.moyvSys.domain.dto.ProblemListDTO;
import com.ipDev.moyvSys.domain.vo.ProblemVO;
import com.ipDev.moyvSys.service.IProblemService;
import com.ipDev.moyvSys.utils.Result;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user/problem")
@Slf4j
@RequiredArgsConstructor
@Api(value = "用户的问题相关接口")
public class UserProblemController {
    private final IProblemService problemService;

    @GetMapping("/problemList")
    public Result<List<ProblemVO>> getProblemList(@RequestBody ProblemListDTO problemListDTO){
        log.info("用户根据书本id或者章节id获取题单,dto:{}",problemListDTO);
        return Result.success(problemService.getProblemList(problemListDTO));
    }
}
